<?php
namespace app\admin\validate;

use think\Validate;

class Mall extends Validate
{
    protected $rule = [
        'mall_name'  =>  'require',
        'mall_img'=>'require',
        'mall_url'  =>  'require|url',
        'sort_order'  =>  'require|regex:/^[1-9]\d*$/',
    ];

    protected $message  =   [
        'mall_name.require' => '商城名称不能为空！',  
        'mall_name.max' => '商城名称不能大于25位！', 
        'mall_img.require'=>'请上传手机图片',
        'mall_url.require'=>'请输入购买地址',
        'mall_url.url'=>'请输入正确网址（必须是http开头）',
       	'sort_order.require'=>'请输入排序值',
        
    ];

    protected $scene = [
        'add' => ['mall_id','mall_name','mall_img','mall_url','sort_order'],
        'edit' => ['mall_id','mall_name','mall_img','mall_url','sort_order']
        
    ];
    
}